// const { default: axios } = require("axios")

var app = new Vue({
    el:'#root',
    data:{
        msg:"hello vue",
        city:'xx',
        weather:[],
        ganmao:''
    },
    methods:{
        getCity:function(){
            console.log(this.city);
        },
        searchWeather:function(){
            // console.log(this.data)
            var that = this;
            axios.get('http://wthrcdn.etouch.cn/weather_mini?city='+this.city)
            .then( function(response){
                // console.log(that.data+'发送请求完毕');
                console.log(response.data);
                that.weather = response.data.data.forecast;
                that.ganmao = response.data.data.ganmao;
            },
            function(err){
                console.log(err);
            })
           
        }
    }
})